"use server"
import { BACKEND_URL } from '@/lib/constants';
import { getSession } from "./session"
import { authFetch } from './authFetch';

const getProfile = async () => {
  const session = await getSession()
  // const response = await fetch(`${BACKEND_URL}/auth/protedted`,{
  //   headers: {
  //     Authorization: `Bearer ${session?.accessToken}`
  //   }
  // })
  
  // const resault = await response.json()
  const response = await authFetch(`${BACKEND_URL}/auth/protedted`);

  const result = await response.json();
  return result
}

export { getProfile }